package com.yang.service.wximpl;

import com.github.pagehelper.PageInfo;
import com.yang.bean.MarketBrand;
import com.yang.bean.MarketBrandExample;
import com.yang.bean.common.CommonData;
import com.yang.mapper.MarketBrandMapper;
import com.yang.service.wx.WXBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName WXBrandServiceImpl
 * @Description:
 * @Author TrueEnd
 * @Date 2022/9/11
 * @Version
 **/
@Service
public class WXBrandServiceImpl implements WXBrandService {

    @Autowired
    MarketBrandMapper marketBrandMapper;


    @Override
    public CommonData<MarketBrand> brandList(Integer page, Integer limit) {
        List<MarketBrand> marketBrands = marketBrandMapper.selectByExample(new MarketBrandExample());
        PageInfo<MarketBrand> pageInfo = new PageInfo<>(marketBrands);

        return CommonData.data(pageInfo);
    }

    @Override
    public MarketBrand brandDetail(Integer id) {
        MarketBrand marketBrand = marketBrandMapper.selectByPrimaryKey(id);
        return marketBrand;
    }
}
